package com.gun.management.module.raffle.controller.app.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Schema(description = "APP -  卡密信息 Request VO")
@Data
@ToString(callSuper = true)
public class AppCardSecretReqVO extends Object {

//    {"orderNo":"240820092407418257053389816299","tradeNo":"SP665172411704681273793","goodsPrice":"9800","orderState":5,"goodsCardPwd":"FWWZDWS8J72SW,FW24Z2FV7Z8CF,FWP7ZTGNS5JEV","goodsCardExpire":"2025-08-20","crtTime":"2024-08-20 09:24:07"}
//])
//
    @Schema(description = "订单号",  requiredMode = Schema.RequiredMode.REQUIRED,   example = "240820092407418257053389816299")
    @JsonProperty("orderNo")
    private String  orderNo;

    @Schema(description = "交易号",  requiredMode = Schema.RequiredMode.REQUIRED,   example = "SP665172411704681273793")
    @JsonProperty("tradeNo")
    private String  tradeNo;

    @Schema(description = "单价",  requiredMode = Schema.RequiredMode.REQUIRED,   example = "98.00")
    @JsonProperty("goodsPrice")
    private BigDecimal goodsPrice;

    @Schema(description = "订单状态",  requiredMode = Schema.RequiredMode.REQUIRED,   example = "5")
    @JsonProperty("orderState")
    private Integer  orderState;


    @Schema(description = "商卡密码",  requiredMode = Schema.RequiredMode.REQUIRED,   example = "FWWZDWS8J72SW,FW24Z2FV7Z8CF,FWP7ZTGNS5JEV")
    @JsonProperty("goodsCardPwd")
    private String  goodsCardPwd;



    @Schema(description = "商卡失效日期",  requiredMode = Schema.RequiredMode.REQUIRED,   example = "2025-08-20")
    @JsonProperty("goodsCardExpire")
    private String  goodsCardExpire;

    @Schema(description = "下单时间",  requiredMode = Schema.RequiredMode.REQUIRED,   example = "2024-06-20 10:00:00")
    @JsonProperty("crtTime")
    private LocalDateTime crtTime;


    @Override
    public String toString() {

        ObjectMapper mapper = new ObjectMapper();
        try {
            return mapper.writeValueAsString(this);
        } catch (
                Exception e) {
            e.printStackTrace();
        }

        return null;
    }

}